from libs.aliyun_mail.alibabacloud_sample.sample import Sample
from typing import List

from alibabacloud_dysmsapi20170525 import models as dysmsapi_20170525_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_console.client import Client as ConsoleClient
from alibabacloud_tea_util.client import Client as UtilClient

class Sms(Sample):
    def main(
        args: List[str],
    ) -> None:
        client = Sample.create_client('ACCESS_KEY_ID', 'ACCESS_KEY_SECRET')
        send_sms_request = dysmsapi_20170525_models.SendSmsRequest(
            sign_name='阿里云短信测试',
            template_code='SMS_154950909',
            phone_numbers=args[0],
            template_param='{"code":"'+args[1]+'"}'
        )
        runtime = util_models.RuntimeOptions()
        resp = client.send_sms_with_options(send_sms_request, runtime)
        ConsoleClient.log(UtilClient.to_jsonstring(resp))